import { request, config } from 'utils'

const { api } = config
const {uploadPdf,uploadHtml,saveFile,getVersion,updateFile} = api

export async function uploadpdf (params) {
  return request({
    url: uploadPdf,
    method: 'post',
    data: params,
    withoutToken: true,
    headers: { 'content-type': 'multipart/form-data' }
  })
}
export async function uploadhtml (params) {
    return request({
      url: uploadHtml,
      method: 'post',
      data: params,
      withoutToken: true,
      headers: { 'content-type': 'multipart/form-data' }
    })
  }
export async function save (params) {
    return request({
      url: saveFile,
      method: 'post',
      data: params,
      withoutToken: true,
    })
  }
  export async function get (params) {
    return request({
      url: getVersion,
      method: 'get',
      data: params,
      withoutToken: true,
    })
  }
  export async function update (params) {
    return request({
      url: updateFile,
      method: 'post',
      data: params,
      withoutToken: true,
    })
  }
